<?php

/**
 * Solicitud form base class.
 *
 * @method Solicitud getObject() Returns the current form's model object
 *
 * @package    courier
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseSolicitudForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'sol_id'                 => new sfWidgetFormInputHidden(),
      'sol_estado'             => new sfWidgetFormInputText(),
      'sol_fecha'              => new sfWidgetFormDate(),
      'sol_libretarecoleccion' => new sfWidgetFormPropelChoice(array('model' => 'Libretarecoleccion', 'add_empty' => false)),
      'sol_libretaentrega'     => new sfWidgetFormPropelChoice(array('model' => 'Libretaentrega', 'add_empty' => true)),
      'sol_cliente'            => new sfWidgetFormPropelChoice(array('model' => 'Cliente', 'add_empty' => false)),
      'sol_emprecolector'      => new sfWidgetFormPropelChoice(array('model' => 'Empleado', 'add_empty' => true)),
      'sol_empdespachador'     => new sfWidgetFormPropelChoice(array('model' => 'Empleado', 'add_empty' => true)),
      'sol_metodopago'         => new sfWidgetFormPropelChoice(array('model' => 'Metodopago', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'sol_id'                 => new sfValidatorChoice(array('choices' => array($this->getObject()->getSolId()), 'empty_value' => $this->getObject()->getSolId(), 'required' => false)),
      'sol_estado'             => new sfValidatorString(array('max_length' => 30)),
      'sol_fecha'              => new sfValidatorDate(),
      'sol_libretarecoleccion' => new sfValidatorPropelChoice(array('model' => 'Libretarecoleccion', 'column' => 'lre_id')),
      'sol_libretaentrega'     => new sfValidatorPropelChoice(array('model' => 'Libretaentrega', 'column' => 'len_id', 'required' => false)),
      'sol_cliente'            => new sfValidatorPropelChoice(array('model' => 'Cliente', 'column' => 'cli_id')),
      'sol_emprecolector'      => new sfValidatorPropelChoice(array('model' => 'Empleado', 'column' => 'emp_id', 'required' => false)),
      'sol_empdespachador'     => new sfValidatorPropelChoice(array('model' => 'Empleado', 'column' => 'emp_id', 'required' => false)),
      'sol_metodopago'         => new sfValidatorPropelChoice(array('model' => 'Metodopago', 'column' => 'met_id')),
    ));

    $this->widgetSchema->setNameFormat('solicitud[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Solicitud';
  }


}
